from env_tools import get_env_value
from langchain_community.chat_models import ChatTongyi

api_key = get_env_value("QIANWEN_API_KEY")
if api_key is None:
    raise ValueError("请设置环境变量QIANWEN_API_KEY")

# 创建模型实例
model = ChatTongyi(
    model = "qwen3-max",
    temperature=0,
    max_tokens=None,
    api_key=api_key,
    max_retries=2,
    timeout=None
)

print(model.invoke("1+1等于多少?"))


